#include <limits.h>
#include <stdio.h>
#define MAX(A, B) (A) > (B) ? (A) : (B)
#define MIN(A, B) (A) > (B) ? (B) : (A)

void get_min_max(int n, int *nums, int *min, int *max) {
  *min = INT_MAX;
  *max = INT_MIN;
  for (int i = 0; i < n; i++) {
    *min = MIN(*min, nums[i]);
    *max = MAX(*max, nums[i]);
  }
}

int main() {
  int arr[10] = {5, 6, 5, 1, 6, 4, 5, 456, 45, 6};
  int min, max;
  get_min_max(10, arr, &min, &max);
  printf("%d\t%d", min, max);
  return 0;
}
